<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>试题列表</title>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<body>
<script type="text/javascript">

$(function(){
	
	$("#hhy_testquestion_findAll_datagrid").datagrid({onDblClickRow:function(row){
		//找到选中的行
		var row = $("#hhy_testquestion_findAll_datagrid").datagrid("getSelected");
		if(!row){
			$.messager.alert('提示', '没有选中要编辑的行！');
			return;
		}
			$(".testquestion_").panel({
				href:"testquestion_update?testQuestions="+row.testQuestions
				
			})
		}

	});
	
	$("#testquestion_clear").linkbutton({onClick:function(){
		//找到选中的行
		var row = $("#hhy_testquestion_findAll_datagrid").datagrid("getSelected");
		if(!row){
			$.messager.alert('提示', '没有选中要删除的行！');
			return;
		}
		
		$.messager.confirm('确认', '真的要删除吗？', function(v){
			$("<form method = 'post'>").appendTo(document.body).form({
				url:'testquestions_delete',
				onSubmit:function(params){
					params["testQuestions"] =row.testQuestions;
				},success:function(v){
					v = eval("(" + v + ")");
					if(v.success){
						
						$.messager.alert('恭喜', '删除成功');
						$('#hhy_testquestion_findAll_datagrid').datagrid('reload');
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
					}
				}
			}).submit();

		});
	}});
	
	
	
	
});

</script>
<style>
	.line{
		margin:10px 20px;
	}
</style>
<div class="easyui-panel testquestion_" data-options="fit:true,border:false">
	<table class="easyui-datagrid" id="hhy_testquestion_findAll_datagrid" style="text-align:center;" data-options="
		method:'post',
		url:'to_testquestions_findAll',
		fitColumns:true,
		fit:true,
		nowrap:false,
		autoRowHeight:true,
		rownumbers:true,
		singleSelect:true,
		pagination:true,
		pageList:[5,10,15,20],
		pageSize:5,
		striped:true,
		toolbar:'#testquestion'
	">
		<thead>
			<tr>
				<th data-options="field:'testQuestions',align:'center',width:20">试题</th>
				<th data-options="field:'questionType',align:'center',width:20">题型</th>
				<th data-options="field:'quName',align:'center',width:20">题库</th>
				<th data-options="field:'quesContent',align:'center',width:80">题目内容</th>
				<th data-options="field:'quesDifficulty',align:'center',width:20">难易度</th>
				<th data-options="field:'quesState',align:'center',width:20">状态</th>
			</tr>
		</thead>
		<tbody>
			
		</tbody>
	</table>
	<div id="testquestion">
		<a href="#" class="easyui-linkbutton" id="testquestion_clear" data-options="iconCls:'icon-clear',plain:true,text:'删除'"></a>
		题库    <select class="easyui-combobox" data-options="width:100,height:25,panelHeight:'auto',editable:false">
				<c:forEach items="${multiple}" var="m">
					<option value="${m.quId}">${m.quName}</option>
				</c:forEach>
			</select>	
		搜索文本  <input id="testquestion_bir" class="easyui-textbox" data-options="width:100,placeholder:'编号，名称'">
		<a id="testquestion_btn" class="easyui-linkbutton" data-options="width:60,plain:false,text:'搜索'"></a> 
	</div>
	</div>
</body>
</html>